<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    //单词字符， 长度6-12
    var reg1 = /^\w{6,12}$/;
    //手机号，1开头，11位
    var reg2 = /^[1]\d{10}$/;
    var str1 = "abc";
    var str2 = "17679388735"
    var flag1 = reg1.test(str1);
    // document.write(flag1);
    var flag2 = reg2.test(str2);
    document.write(flag2);
</script>
</body>
</html>